#from django.db.models.signals import post_save
from django.dispatch import receiver, Signal

#from assets.models import Asset

asset_changed = Signal(providing_args=[])

#@receiver(asset_changed, sender=Asset, dispatch_uid="v")
@receiver(asset_changed, dispatch_uid="v")
def asset_changedCB(sender, **kwargs):
  print('asset_changedCB!')
  #If the asset changes, put all objects that use this asset
  # in updated state.
  for object in sender.object_set.all():
      object.state = 'U'
      object.save()
